﻿using System;

namespace ConsoleApp2
{
    class Program
    {
        private string name;
        private int telphone;
        private string address;

        struct PersonClass
        {
            public string name;
            public int telphone;
            public string address;

            internal void output()
            {
                Console.WriteLine("我的姓名是{0}，电话是{1}，地址是{2}", this.name, this.telphone , this.address);
            }
        }
        struct PersonStruct {
            public string name;
            public int telphone;
            public string address;

            internal void output()
            {
                Console.WriteLine("我的姓名是{0}，电话是{1}，地址是{2}", this.name, this.telphone , this.address);
            }
        }
        public void PersonStructs(string name, int telphone, string address)
        {
            this.name = name;
            this.telphone = telphone;
            this.address = address;
        }
        public void output(string name)
        {
            Console.WriteLine("我的姓名是{0}，电话是{1}，地址是{2}", this.name, this.telphone, this.address);
        }
    
    static void Main(string[] args)
        {
            //        定义一个结构体，名为PersonStruct，有三个成员变量：姓名、电话、地址，
            //在主方法中，创建一个PersonStruct结构体对象p1，为p1的成员变量赋值。
            //再声明一个PersonStruct结构体变量p2，把p1赋值给p2，改变p2的姓名，打印p1的内容。
            PersonStruct p1;
            p1.name = "邓伦";
            p1.telphone =19874;
            p1.address = "河北";
            p1.output();

            PersonStruct p2=p1 ;
            p2.name = "张一山";
            p1.output();

            //定义一个类，名为PersonClass，有三个成员变量：姓名、电话、地址，
            //在主方法中，创建一个PersonClass对象p3，为p3的成员变量赋值。
            //再声明一个PersonClass变量p4，把p3赋值给p4，改变p4的姓名，打印p3的内容。
            PersonClass p3;
            p3.name = "周恩来";
            p3.telphone =25456-64;
            p3.address = "北京";
            p3.output();

            PersonClass p4 = p3;
            p4.name = "嬴政";
            p3 .output();


        }
    }
}
